home *** CD-ROM | disk | FTP | other *** search
/ SGI Varsity Update 1998 August / SGI Varsity Update 1998 August.iso / dist / patchSG0002777.idb / usr / include / sys / syssgi.h.z / syssgi.h
C/C++ Source or Header  |  1998-07-29  |  15KB  |  453 lines

  1. /**************************************************************************
  2.  *                                      *
  3.  *          Copyright (C) 1986-1993 Silicon Graphics, Inc.          *
  4.  *                                      *
  5.  *  These coded instructions, statements, and computer programs  contain  *
  6.  *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
  7.  *  are protected by Federal copyright law.  They  may  not be disclosed  *
  8.  *  to  third  parties  or copied or duplicated in any form, in whole or  *
  9.  *  in part, without the prior written consent of Silicon Graphics, Inc.  *
  10.  *                                      *
  11.  **************************************************************************/
  12.  
  13. #ifndef __SYSSGI_H__
  14. #define __SYSSGI_H__
  15.  
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19.  
  20. #ident "$Revision: 3.129 $"
  21.  
  22. #include <sys/types.h>
  23.  
  24. /*
  25. ** syssgi() system call commands.
  26. */
  27.  
  28. #define SGI_SYSID        1    /* get the system ID */
  29. #define    SGI_TUNE        3    /* change tune values --
  30.                         see sys/tuneable.h */
  31. #define    SGI_IDBG        4    /* access to internal debugger */
  32. #define SGI_INVENT        5    /* hardware inventory */
  33. #define SGI_RDNAME        6    /* get name of process given pid */
  34. #define SGI_SETLED        7    /* set cpu board led state(s) */
  35. #define SGI_SETNVRAM        8    /* set nvram */
  36. #define SGI_GETNVRAM        9    /* get nvram */
  37. #define SGI_QUERY_FTIMER        12
  38. #define SGI_QUERY_CYCLECNTR    13
  39. #define SGI_PROCSZ        14    /* recalc p_size, p_rsssize */
  40.  
  41. /* POSIX signal system calls */
  42. #define SGI_SIGACTION        15
  43. #define SGI_SIGPENDING        16
  44. #define SGI_SIGPROCMASK    17
  45. #define SGI_SIGSUSPEND        18
  46. /* Other POSIX system calls */
  47. #define SGI_SETSID    20
  48. #define SGI_SETPGID    21
  49. #define SGI_SYSCONF    22
  50. #define SGI_WAIT4    23
  51. #define SGI_PATHCONF    24
  52.  
  53.  
  54. /* Block read & Block write system calls: to allow access to > 2 gig
  55.  * of space on a disk or logical volume for large filesystems.
  56.  */
  57. #define SGI_READB    30
  58. #define SGI_WRITEB    31
  59.  
  60. /* setgroups() and getgroups() system calls */
  61. #define SGI_SETGROUPS    40
  62. #define SGI_GETGROUPS    41
  63.  
  64. #define SGI_SETTIMEOFDAY    52    /* set time including microseconds */
  65. #define SGI_SETTIMETRIM        53    /* change crystal trimmer */
  66. #define SGI_GETTIMETRIM        54
  67. #define SGI_SPROFIL        55    /* sprofil(2) entry point */
  68. #define SGI_RUSAGE        56    /* Berkeley's getrusage(2) */
  69. #define SGI_SIGSTACK        57    /* Berkeley's sigstack(2) */
  70. #define SGI_SIGSTATUS        58    /* sgi call to support BSD longjmp */
  71. #define SGI_NETPROC        59    /* start network process */
  72. #define SGI_SIGALTSTACK        60    /* SVR4 sigaltstack(2) */
  73. #define SGI_BDFLUSHCNT        61    /* change bdflushcnt */
  74. #define SGI_SSYNC        62    /* synchronous sync */
  75. #define SGI_NFSCNVT        63    /* convert file handle to descriptor */
  76. #define SGI_GETPGID             64      /* SVR4 getpgid */
  77. #define SGI_GETSID              65      /* SVR4 getsid */
  78. #define SGI_IOPROBE        66    /* I/O probing */
  79. #define SGI_CONFIG        67    /* get configuration data */
  80. #define SGI_ELFMAP        68    /* atomically mmap in an elf dso */
  81. #define SGI_MCONFIG        69    /* loadable module configuration */
  82.  
  83. /*
  84.  * Trusted IRIX system calls
  85.  */
  86. /* mandatory access (MAC) */
  87. /*
  88.  * XXX: the next four interfaces should be obsoleted by the more
  89.  *    general SGI_EAG_[SG]ET... interfaces.
  90.  */
  91. #define SGI_GETPLABEL        70    /* Get process label */
  92. #define SGI_SETPLABEL        71    /* Set process label */
  93. #define SGI_GETLABEL        72    /* Get file label */
  94. #define SGI_SETLABEL        73    /* Set file label */
  95. /* audit (SAT) */
  96. #define SGI_SATREAD        74    /* Read audit rec from the kernel */
  97. #define SGI_SATWRITE        75    /* Write audit rec to the kernel */
  98. #define SGI_SATCTL        76    /* Control/query the audit stream */
  99. /* extended attribute handling */
  100. #define SGI_LOADATTR        77    /* Load attributes database */
  101. #define SGI_UNLOADATTR        78    /* Unload attributes database */
  102. /* trusted sockets */
  103. #define SGI_RECVLUMSG        79    /* recvmsg() with label and uid */
  104. /* more extended attribute handling */
  105. #define SGI_PLANGMOUNT        80    /* mount() with PlanG info */
  106. /* trusted sockets with DAC */
  107. #define SGI_GETPSOACL        81    /* Get process socket ACL. */
  108. #define SGI_SETPSOACL        82    /* Set process socket ACL.  */
  109. /* still more extended attribute handling */
  110. #define SGI_EAG_GETATTR        83    /* Get the named file attribute */
  111. #define SGI_EAG_SETATTR        84    /* Set the named file attributes */
  112. #define SGI_EAG_GETPROCATTR    85    /* Get the named process attribute */
  113. #define SGI_EAG_SETPROCATTR    86    /* Set the named process attributes */
  114. #define SGI_REVOKE        87    /* Revoke access to a device */
  115. #define SGI_FREVOKE        SGI_REVOKE /* Poor name choice from 4.0.5TRIX */
  116. /*reserved            88*/
  117. /*reserved            89*/
  118. #define SGI_SBE_GET_INFO        98      /* get SBE count on a mc3 board*/
  119. #define SGI_SBE_CLR_INFO        99      /* clear SBE count on a mc3 board */
  120. #define SGI_RMI_FIXECC        100    /* RMI read ECC-correct on/off (1/0) */
  121. #define SGI_R4K_CERRS        101    /* return set of ECC cache-err cnts */
  122. #define SGI_GET_EVCONF        102    /* Get the "evconfig" structure
  123.                      * built by the IP19 prom. */
  124.  
  125. #define SGI_MPCWAROFF        103    /* turn off libmpc WAR handling */
  126. #define SGI_SET_AUTOPWRON    104    /* set auto power on time */
  127. #define SGI_SPIPE        105    /* set stream pipe */
  128. #define SGI_SYMTAB        106    /* get runtime symtab info */
  129. #define    SGI_SET_FP_PRECISE    107    /* set/clear precise FP exception mode*/
  130. #define SGI_TOSSTSAVE        108    /* toss any saved pregions */
  131. #define SGI_FDHI        109    /* return highest valid fd */
  132. #define    SGI_SET_CONFIG_SMM    110    /* set/clear sequential memory mode */
  133. #define    SGI_SET_FP_PRESERVE    111    /* preserve p_fpflags across exec */
  134. #define SGI_MINRSS        112    /* minrss */
  135. #define    SGI_GRIO        113    /* guaranteed rate I/O */
  136. #define    SGI_XLV_SET_TAB        114    /* set incore logical volume config */
  137. #define    SGI_XLV_GET_TAB        115    /* get incore logical volume config */
  138. #define    SGI_GET_FP_PRECISE    116    /* get precise FP exception mode */
  139. #define    SGI_GET_CONFIG_SMM    117    /* get sequential memory mode */
  140. #define    SGI_FP_IMPRECISE_SUPP    118    /* does hw support imprecise mode? */
  141. #define    SGI_CONFIG_NSMM_SUPP    119    /* does hw support non-seq mem mode? */
  142.                     /* 120 and 121 are available */
  143.  
  144. /* Frame Scheduler Timestamping Control */
  145.                         
  146. #define SGI_RT_TSTAMP_CREATE    122 /* create timestamping buffer for specific cpu */
  147. #define SGI_RT_TSTAMP_DELETE    123 /* delete timestamping buffer */
  148. #define SGI_RT_TSTAMP_START     124 /* start logging timestamps */
  149. #define SGI_RT_TSTAMP_STOP      125 /* stop logging timestamps */
  150. #define SGI_RT_TSTAMP_ADDR      126 /* get physical addr for timestamp buffer */
  151. #define SGI_RT_TSTAMP_MASK      127 /* set tstamp mask */
  152. #define SGI_RT_TSTAMP_EOB_MODE  128 /* set end-of-buffer action */
  153.                     
  154. #define    SGI_USE_FP_BCOPY    129    /* should bcopy/bzero use fp? */
  155.  
  156. #define SGI_GET_UST        130    /* get unadjusted system time value */
  157.  
  158. #define SGI_SPECULATIVE_EXEC    131    /* turn speculative execution on/off */
  159.  
  160. #define SGI_XLV_NEXT_RQST    132    /* wait for next xlv configuration
  161.                        request. */
  162. #define SGI_XLV_ATTR_CURSOR    133    /* get cursor for xlv attributes */
  163. #define SGI_XLV_ATTR_GET    134    /* get xlv attribute value */
  164. #define SGI_XLV_ATTR_SET    135    /* set xlv attribute */
  165.  
  166. /* btool - code coverage - only used when compiled with -DBTOOL */
  167. #define SGI_BTOOLSIZE        136
  168. #define SGI_BTOOLGET        137
  169. #define SGI_BTOOLREINIT        138
  170.  
  171. #define    SGI_CREATE_UUID        139    /* create a DCE-defined UUID */
  172.  
  173. /* disable CSR_EXCEPT while in GL address space */
  174. #define SGI_NOFPE        140    /* disable CSR_EXCEPT */
  175.  
  176. #define SGI_OLD_SOFTFP        141    /* use old (asm) softfp code */
  177. #define    SGI_FS_INUMBERS        142    /* xfs get inode number table */
  178. #define    SGI_FS_BULKSTAT        143    /* xfs get stat64 info in bulk */
  179.  
  180. /* more Frame Scheduler calls */
  181. #define SGI_RT_TSTAMP_WAIT    144    /* wait for tstamp buffer to reach 2/3 watermark */
  182. #define SGI_RT_TSTAMP_UPDATE    145     /* update fifo buffer head index */
  183.  
  184. /* things needed by xFS dump and xFS-based DMIG interfaces */
  185. #define    SGI_PATH_TO_HANDLE    146    /* get a file's file handle       */
  186. #define    SGI_PATH_TO_FSHANDLE    147    /* get a file's file system handle */
  187. #define    SGI_FD_TO_HANDLE    148    /* get an open file's file handle  */
  188. #define    SGI_OPEN_BY_HANDLE    149    /* open a file given a file handle */
  189. #define    SGI_READLINK_BY_HANDLE    150    /* read a link using a file handle */
  190.  
  191. #define SGI_READ_DANGID        151    /* Probe for Dang existance */
  192.  
  193. /* Sizing constants used by kmem readers */
  194. #define SGI_CONST        152    /* System sizing constants */
  195. #define SGI_XFS_FSOPERATIONS    153    /* entry of xfs extended operations */
  196.  
  197.  
  198. /* Extended accounting functions */
  199. #define SGI_SETASH        154    /* set array session handle */
  200. #define SGI_GETASH        155    /* get array session handle */
  201. #define SGI_SETPRID        156    /* set project ID */
  202. #define SGI_GETPRID        157    /* get project ID */
  203. #define SGI_SETSPINFO        158    /* set service provider info */
  204. #define SGI_GETSPINFO        159    /* get service provider info */
  205. #define    SGI_SHAREII        160    /* ShareII product syscall */
  206. #define SGI_NEWARRAYSESS    161    /* start new array session */
  207. #define SGI_GETDFLTPRID        162    /* get system default project ID */
  208. #define    SGI_SET_DISMISSED_EXC_CNT 163    /* set dismissed exception count */
  209. #define    SGI_GET_DISMISSED_EXC_CNT 164    /* get dismissed exception count */
  210. /* More cycle counter support */
  211. #define SGI_CYCLECNTR_SIZE    165    /* Size user needs to use to read CC */
  212. #define SGI_QUERY_FASTTIMER    166    /* period of fast itimers in ns */
  213. #define SGI_PIDSINASH        167    /* List PIDs in given array session */
  214. #define SGI_ULI            168
  215.  
  216. /* support for large pages */
  217. #define SGI_LPG_SHMGET          169     /* DBA: use large pages for shared mem */
  218. #define SGI_LPG_MAP             170     /* DBA: use large pages for prog segment */
  219.  
  220. #define SGI_CACHEFS_SYS        171        /* CacheFS system call */
  221. #define SGI_NFSNOTIFY        172        /* lockd client/server failure */
  222. #define SGI_LOCKDSYS        173        /* set lockd options & client name */
  223.  
  224. /*
  225.  * Performance monitoring calls
  226.  */
  227. #define SGI_EVENTCTR            174
  228. #define SGI_GETPRUSAGE          175
  229.  
  230. #define    SGI_PROCMASK_LOCATION    176     /* Used to move p_hold into prda */
  231.  
  232. #define    SGI_UNUSED        177
  233.  
  234. #define    SGI_CKPT_SYS        178     /* checkpoint/restart system call */
  235. #define    SGI_GETGRPPID        179     /* return a list of pid's for a given group */
  236. #define    SGI_GETSESPID        180     /* return a list of pid's for a given session */
  237.  
  238. #define SGI_ENUMASHS        181    /* return a list of all active ASHs */
  239. #define SGI_SETASMACHID        182    /* set array machine ID */
  240. #define SGI_GETASMACHID        183    /* get array machine ID */
  241. #define SGI_GETARSESS        184    /* retrieve arsess info */
  242. #define SGI_JOINARRAYSESS    185    /* join existing array session */
  243.  
  244. #define SGI_SPROC_KILL        186    /* Send a sync. signal to a sproc */
  245.  
  246. #define SGI_DBA_CONFIG        187    /* DBA: get/set database accelerator features */
  247.  
  248.  
  249. /* similar to uname() system call, but returns "official name" for hardware
  250.  * specific releases from the base release.  Takes a count and pointer
  251.  * to a buffer in which to place the name.  name will be no more than 256
  252.  * characters.
  253. */
  254. #define SGI_RELEASE_NAME    188
  255. #define SGI_SYNCH_CACHE_HANDLER 189
  256. #define SGI_SWASH_INIT        190    /* SoftWindows Address Space Helper */
  257.  
  258. /*
  259.  * Numa Migration
  260.  */
  261.  
  262. #define SGI_NUMA_MIGR_PAGE    200    /* migrate a page */
  263. #define SGI_NUMA_MIGR_PAGE_ALT    201    /* migrate a page of other processes */
  264.  
  265. #define SGI_KAIO_USERINIT    202    /* DBA: kernel asyncio process initialization */
  266. #define SGI_KAIO_READ        203    /* DBA: kernel asyncio read request */
  267. #define SGI_KAIO_WRITE        204    /* DBA: kernel asyncio write request */
  268. #define SGI_KAIO_SUSPEND    205    /* DBA: kernel asyncio nap till N I/Os complete */
  269. #define SGI_KAIO_STATS        206    /* DBA: kernel asyncio stats collection */
  270.  
  271.  
  272. #define SGI_INITIAL_PT_SPROC    213    /* make initial proc a pthread sproc */
  273.  
  274. /*
  275.  * The following are needed for
  276.  * implementing syssgi() calls
  277.  * involving very large pages.
  278.  */
  279. /* values for arg4 of SGI_LPG_SHMGET */
  280. #define SGI_LPG_256K            1
  281. #define SGI_LPG_1M              2
  282. #define SGI_LPG_4M              3
  283. #define SGI_LPG_16M             4
  284.  
  285. /* flag (arg5 of SGI_LPG_SHMGET) indicating tlbwire or not */
  286. #define SGI_LPG_WIRE            1
  287.  
  288.  
  289. /* the syssgi() SGI_RMI_FIXECC entrypoint toggles the RMI ecc
  290.  * read-correction. */
  291. #define RMI_ECC_OFF        0
  292. #define RMI_ECC_ON        1
  293.  
  294. #if (defined(R4000) && defined(_FORCE_ECC))
  295. /* Debug stuff uses numbers up around 1000 */
  296. #define SGI_FORCE_ECC        1010    /* debug - force ecc errors */
  297.  
  298. enum force_ecc_where { IN_PD, IN_PI, IN_SD, IN_SI, IN_MEM, IN_MEM_IO3 };
  299.  
  300. /* each double-word in memory has an 8-bit ECC checkbit value that
  301.  * is computed and stored with it. */
  302. typedef struct ecc_data_word {
  303.     uint hi_word;
  304.     uint lo_word;
  305.     u_char ecc_val;
  306. } ecc_data_word_t;
  307. #endif /* R4K and _FORCE_ECC */
  308.  
  309. #define SGI_PHYSP        1011    /* get phys pgno for vaddr */
  310.  
  311. /*
  312.  * kernel threads temporary
  313.  */
  314.  
  315. #define    SGI_KTHREAD        1012
  316.  
  317. /*reserved            1020*/
  318.  
  319. /*
  320.  * kernel pathconf() must know whether called by fpathconf or 
  321.  * pathconf--i.e how to interpret the 1st parameter.  (It is not
  322.  * currently used at all, but may be in the future.)
  323.  */
  324. #define PATHCONF    1
  325. #define FPATHCONF    2
  326.  
  327.  
  328. #define    GET_SYSID    SGI_SYSID    /* compatability */
  329. #define    MAXSYSIDSIZE    64    /* maximum size in bytes of the system id   */
  330.  
  331. /* hardware inventory options */
  332. #define SGI_INV_SIZEOF    1    /* get sizeof inventory struct */
  333. #define SGI_INV_READ    2    /* read inventory table */
  334.  
  335. /* configuration data options */
  336. #define ADAP_READ     1
  337. #define ADD_NODE      2
  338. #define DELETE_NODE      3
  339. #define GET_NODE      4
  340.  
  341. /* IO probe directions */
  342. #define IOPROBE_READ    0
  343. #define IOPROBE_WRITE    1
  344.  
  345. /* nvram options */
  346. #define SGI_NVSTRSIZE    4096    /* Need big buffer for fru logging */
  347.  
  348. /* SGI_MINRSS options */
  349. #define MINRSS_ADDPNAME        1
  350. #define MINRSS_DELPNAME        2
  351. #define MINRSS_LISTPNAME    3
  352. #define MINRSS_ADDVNODE        4
  353. #define MINRSS_DELVNODE        5
  354. #define MINRSS_LISTVNODE    6
  355. /* struct for LISTPNAME */
  356. #define MINRSS_PNAMESZ        20
  357. struct getpname {
  358.     char g_name[MINRSS_PNAMESZ];
  359.     pgno_t g_minrss;
  360. };
  361. /* struct for LISTVNODE */
  362. struct getvnode {
  363.     dev_t g_fsid;
  364.     ino_t g_nodeid;
  365.     pgno_t g_minrss;
  366. };
  367.  
  368. #ifdef _KERNEL
  369. struct irix5_getvnode {
  370.     __int32_t g_fsid;
  371.     __uint32_t g_nodeid;
  372.     __int32_t g_minrss;
  373. };
  374. #endif
  375.  
  376. /* EXTENDED MEMORY operations (though sgifastpath syscall)
  377.  * Intended to be used by the HIPPI controller to provide a fastpath for
  378.  * low latency memory operations.  Device driver will specify a range of
  379.  * addresses which the user can read/write using the following syssgi calls.
  380.  */
  381. #define SGIFAST_PIOMEM_BREAD32    0    /* extended memory block read */
  382. #define    SGIFAST_PIOMEM_BWRITE32    1    /* extended memory block write */
  383. #define    SGIFAST_PIOMEM_NULL    2    /* extended memory NOP */
  384.  
  385. /*
  386.  * SGI_CONST parameters
  387.  */
  388. #define SGICONST_MBUF        1    /* Mbuf */
  389. #define SGICONST_PTE        2    /* Pte */
  390. #define SGICONST_PAGESZ        3    /* _PAGESZ */
  391. #define SGICONST_PARAM        4    /* Param */
  392.  
  393. /* SGI_ULI options */
  394. enum {
  395.     /* These options are used from the top half of a process, i.e. they
  396.      * are ordinary system calls
  397.      */
  398.  
  399.     ULI_SLEEP,
  400.     ULI_DEBUG,
  401.     ULI_SET_DEBUG_SIG,
  402.  
  403.     /* These options are used from the bottom half of the process, i.e.
  404.      * they are interrupt mode calls
  405.      */
  406.  
  407.     ULI_RETURN,
  408.     ULI_CPUID,
  409.     ULI_WAKEUP,
  410.     ULI_CONWRITE,
  411.  
  412.     ULI_MAXCALL
  413. };
  414.  
  415. /*
  416.  * SGI_PROCMASK_LOCATION options
  417.  */
  418. #define USER_LEVEL    1
  419. #define KERNEL_LEVEL    2
  420.  
  421. #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
  422. #ifndef _KERNEL
  423. #include <stddef.h>
  424. extern ptrdiff_t syssgi(int, ...);
  425. #endif /* !_KERNEL */
  426. #endif
  427.  
  428. #if _KERNEL
  429. #include <sys/systm.h>
  430.  
  431. struct syssgia {
  432.     sysarg_t cmd;
  433.     sysarg_t arg1, arg2, arg3, arg4, arg5, arg6, arg7;
  434. };
  435.  
  436. extern int syssgi(struct syssgia *, rval_t *);
  437.  
  438. /* procscan parameters for findash */
  439. struct findashinfo {
  440.     ash_t    ash;
  441.     pid_t    *useraddr;
  442.     int    usermax;
  443.     int    count;
  444.     int    current;
  445.     int    errno;
  446. };
  447. #endif    /* _KERNEL */
  448.  
  449. #ifdef __cplusplus
  450. }
  451. #endif
  452. #endif /* __SYSSGI_H__ */
  453.